package com.aplink.dellcommercial.webservices;

import java.io.Serializable;
import java.util.HashMap;

public class MethodParams implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 6152076963376168324L;

    private final HashMap<String, Object> mHasMap = new HashMap<String, Object>();
    private Object mInputData;
    private boolean mIs4Cache = false;
    private final Methods mName;
    private int mOffset = 0;
    private int mSize;

    private String mTag;

    public MethodParams( Methods method ) {
        this.mName = method;
    }

    public MethodParams( Methods method, int offset, int size ) {
        this.mName = method;
        this.mSize = size;
        this.mOffset = offset;
    }

    public MethodParams( Methods method, int offset, int size, Object inputData ) {
        this.mName = method;
        this.mSize = size;
        this.mOffset = offset;
        this.mInputData = inputData;
    }

    public MethodParams( Methods method, int offset, int size, Object inputData,
                         String tag ) {
        this.mName = method;
        this.mSize = size;
        this.mOffset = offset;
        this.mInputData = inputData;
        this.mTag = tag;
    }

    public MethodParams( Methods method, Object inputData ) {
        this.mName = method;
        this.mInputData = inputData;
    }

    public Object getInputData() {
        return this.mInputData;
    }

    public Methods getName() {
        return this.mName;
    }

    public int getOffset() {
        return this.mOffset;
    }

    public int getSize() {
        return this.mSize;
    }

    public String getTag() {
        return this.mTag;
    }

    public Object getTag( String name ) {
        return this.mHasMap.get( name );
    }

    public boolean isOnly4Cache() {
        return this.mIs4Cache;
    }

    public void setInputData( Object inputData ) {
        this.mInputData = inputData;
    }

    public void setOnly4Cache( boolean cache ) {
        this.mIs4Cache = cache;
    }

    public void setTag( String name, Object value ) {
        this.mHasMap.put( name, value );
    }
}
